{% extends 'Ionafan2GetonlyimgBundle::layout.html.twig' %}

{% block stylesheets %}
{{ parent() }}
<style type="text/css">
    .gallery {
        overflow: hidden;
    }

    .gallery .image_block {
        float: left;
        margin: 0 19px 12px 0;
        width: 162px;
    }

    .gallery_img {
        width: 160px;
        height: 100px;
    }
</style>
{% endblock %}

{% block content %}

    <form action="{{ path('index') }}" method="post" {{ form_enctype(form) }} class="form-inline text-center">
        {{ form_errors(form.url) }}
        {{ form_widget(form.url) }}
        {{ form_rest(form) }}
        <button type="submit" class="btn">Get images</button>
    </form>

    {% if links %}
        <div class="gallery">
            {% for src in links %}
              <div class="image_block">
                  <a class="gallery_link" rel="group" href="{{ src }}"><img class="gallery_img" width="160" height="100" src="{{ src }}"/></a>
              </div>
            {% endfor %}
        </div>
    {% endif %}

{% endblock %}
